﻿using System.Collections.Generic;
using System.ComponentModel;

namespace LightController
{
    public enum LIGHT_TYPE
    {
        Rsee,
        OPT
    }
    public interface ILightController : INotifyPropertyChanged
    {
        /// <summary>
        /// ID 创建时生成，不可修改,用于查找
        /// </summary>
        string ID { get; set; }
        bool IsConnect { get; }
        /// <summary>
        /// 控制器的通道数量
        /// </summary>
        int ChanelCount { get; set; }
        /// <summary>
        /// 通道列表
        /// </summary>
        List<LightChanel> ChanelList { get; set; }
        /// <summary>
        /// 自定义的光源控制器名称
        /// </summary>
        string Name { get; set; }
        /// <summary>
        /// 通讯地址：可配置IP地址（eg：192.168.1.100），或者COM口（eg：COM1）
        /// </summary>
        string CommunicationAddress { get; set; }
        /// <summary>
        /// 连接到光源控制器
        /// </summary>
        /// <returns></returns>
        bool Connect();
        /// <summary>
        /// 断开光源控制器
        /// </summary>
        /// <returns></returns>
        bool Disconnect();
        /// <summary>
        /// 向指定通道写入指定的值
        /// </summary>
        /// <param name="ch"></param>
        /// <param name="val"></param>
        bool SetIntensity(int ch, int val);

        /// <summary>
        /// 向指定通道读取值
        /// </summary>
        /// <param name="ch"></param>
        /// <param name="val"></param>
        bool ReadIntensity(int ch, ref int val);
        /// <summary>
        /// 控制器状态信息
        /// </summary>
        string Status { get; }
        /// <summary>
        /// 关闭所有通道
        /// </summary>
        bool CloseAllLight();
        /// <summary>
        /// 打开所有通道
        /// </summary>
        bool OpenAllLight();
        /// <summary>
        /// 同时打开多个通道
        /// </summary>
        /// <param name="chs"></param>
        /// <param name="vals"></param>
        /// <returns></returns>
        bool SetMultiIntensity(List<int> chs, List<int> vals);

        bool SetMultiIntensity(List<int> chs, List<int> vals, string ProdcutAdress, string Adress, int openCount);
    }
}
